<template>
	<view class="box">
		<view class="empty">
			
		</view>
		<view class="main">
			<view class="mainitem"  >
				<text>下单时自动加入商家粉丝群</text>
				<u-switch v-model="fansShow" @change="changeFs" activeColor="#FFC300"
					inactiveColor="rgb(230, 230, 230)"></u-switch>
			</view>
		</view>

	</view>
</template>

<script>
	import {userGroupDetails,settingUserGroup} from "../../api/hx.js"
	export default {
		data() {
			return {
				fansShow: false,
				messageShow:false,
				// baseUrl: this.$imageBaseUrl,
			}
		},
		onLoad() {
			this.getdetal()
		},
		
		methods: {
			getdetal(){
				userGroupDetails({}).then(res=>{
					if(res.data.is_order_seller_group==1){
						this.fansShow=true
					}else{
						this.fansShow=false
					}
					
				})
			},
			changeFs(e){
				let a=null
				if(e==true){
					a=1
				}else{
					a=0
				}
				
				settingUserGroup({
					is_order_seller_group:a
				}).then(res=>{
					uni.$u.toast(res.msg)
				})
				console.log(e)
			},
			changeTz(){
				
			}
		},
	}
</script>

<style lang="scss">
.box{
	width: 750rpx;
	height: 100vh;
	background: #F7F7F7;
}
.main{
width: 750rpx;
background: #FFFFFF;
border-radius: 0rpx 0rpx 0rpx 0rpx;
}
.mainitem{
	width: 690rpx;
	height: 92rpx;
	margin: 0 auto;
	border-bottom:2rpx solid #F7F7F7;
	display: flex;
	align-items: center;
	justify-content: space-between;
	>text{
		font-weight: 400;
		font-size: 30rpx;
		color: #3D3D3D;
	}
	>image{
		width: 14rpx;
		height: 28rpx;
	}
}
.empty{
	width: 750rpx;
	height: 24rpx;
	background: #F7F7F7;
}
.btn{
	width: 750rpx;
	height: 90rpx;
	background: #FFFFFF;
	border-radius: 0rpx 0rpx 0rpx 0rpx;
	text-align: center;
	line-height: 90rpx;
	margin-top: 94rpx;
	font-weight: 400;
	font-size: 30rpx;
	color: #3D3D3D;
}
</style>
